package org.agile4j.rpc.ngbc.client;

import org.agile4j.rpc.client.RpcProxy;
import org.agile4j.rpc.ngbc.pojo.Person;
import org.agile4j.rpc.ngbc.service.HelloService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class HelloClient {
	private static final Logger LOGGER = LoggerFactory.getLogger(HelloClient.class);

	public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
		RpcProxy rpcProxy = context.getBean(RpcProxy.class);

		HelloService helloService = rpcProxy.create(HelloService.class);
		String result = helloService.hello(new Person("Yongxu", "Han"));
		LOGGER.debug(result);

		System.exit(0);
	}
}